home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / IIGS / TN.IIGS.065 < prev    next >
Encoding:
Text File  |  1989-09-03  |  2.4 KB  |  60 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6.  
  7. Apple IIGS
  8. #65:    Control-^ is Harder Than It Looks
  9.  
  10. Written by:    Dave Lyons                                      September 1989
  11.  
  12. This Technical Note describes a problem using Control-^ to change the text 
  13. cursor with programs that use GETLN.
  14. _____________________________________________________________________________
  15.  
  16. On the Apple IIGS, typing Control-^ changes the cursor to the next character 
  17. typed.  This feature works properly from the keyboard, but there is a problem 
  18. when programs print the control sequence.  Try entering the following from 
  19. AppleSoft to demonstrate this problem:
  20.  
  21.     NEW
  22.     PRINT CHR$(30);"_"
  23.  
  24. It changes the cursor into a blinking underscore, as expected.  But now enter 
  25. the following:
  26.  
  27.     12345 HOME
  28.     LIST
  29.  
  30. You should see 2345 HOME, which demonstrates that the first character is 
  31. ignored.  This is a problem with GETLN, which AppleSoft uses to read each line 
  32. of input.  Even if your program does not use this routine, you should be aware 
  33. of this problem since it will occur the next time another program uses GETLN.
  34.  
  35. Since changing the cursor works fine when done from the keyboard, the way to 
  36. work around this problem is to have your program simulate the appropriate 
  37. keypresses for GETLN.
  38.  
  39.     301: CLD                        ; required by BASIC.SYSTEM
  40.     302: STA ($28),Y                ; remove cursor if present
  41.     304: LDY $0300                  ; get index into simulated-keys list
  42.     307: LDA $310,Y                 ; get a simulated keypress
  43.     30A: INC $0300                  ; point to the next key for next time
  44.     30B: RTS                        ; return the key to GETLN
  45.  
  46.     310: 9E DF 8D                   ; Ctrl-^, underscore, return
  47.  
  48.     100 POKE 768,0:PRINT CHR$(4);"IN#A$301":REM Start getting simulated keys
  49.     110 INPUT "";A$
  50.     120 PRINT CHR$(4);"IN#0":REM Get real keys again
  51.  
  52. From an assembly-language program, the equivalent of IN#A$301 is storing $01 
  53. and $03 in locations $38 and $39, while the equivalent of INPUT is JSR $FD6A 
  54. (GETLN).  (Store a harmless prompt character, like $80, into location $33 
  55. first.)
  56.  
  57.  
  58. Further Reference
  59. _____________________________________________________________________________
  60.   o  Apple IIGS Firmware Reference, p. 77